package com.atguigu.gulimall.member.service;

import com.atguigu.gulimall.member.exception.PhoneExistException;
import com.atguigu.gulimall.member.exception.UserNameExistException;
import com.atguigu.gulimall.member.vo.MemberLoginVo;
import com.atguigu.gulimall.member.vo.MemberRegistVo;
import com.atguigu.gulimall.member.vo.SocialUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.member.entity.MemberEntity;

import java.util.Map;

/**
 * 会员
 *
 * @author yanglinfengkk
 * @email 2640646499@qq.com
 * @date 2020-06-06 10:08:52
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 注册会员信息   认证服务调用
     * @param memberRegistVo
     */
    void regIst(MemberRegistVo memberRegistVo);

    /**
     * 检查phone是否唯一
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws PhoneExistException;

    /**
     * 检查用户名是否唯一
     * @param userName
     * @return
     */
    void checkUserNameUnique(String userName) throws UserNameExistException;

    /**
     * 基本登录操作
     * @param vo
     * @return
     */
    MemberEntity login(MemberLoginVo vo);

    /**
     * 微博登录操作
     * @param socialUser
     * @return
     */
    MemberEntity login(SocialUser socialUser) throws Exception;
}

